package com.profound.notes.mvvm;

/**
 * @author zjwujlei
 * @date 2021/4/24
 * @email zjwujlei@sina.com
 * @description
 */
public abstract class ViewModel {

    protected ViewModelProvider mProvider;

    protected void onCleared(){}

    /**
     * attach the ViewModelProvider,so the ViewModel can use other ViewModel in same ViewModelProvider.
     * @param provider
     */
    public void attachProvider(ViewModelProvider provider){
        if(mProvider == null){
            mProvider = provider;
        }
    }
}
